//
//  GlobalConfig.h
//  HuHu
//
//  Created by 黄定坤 on 11/28/15.
//  Copyright © 2015 ruiyun. All rights reserved.
//

#ifndef GlobalConfig_h
#define GlobalConfig_h

/**************控制不同环境下使用的url****************/

//0:测试环境   2:外网正式环境

#define URL_CONDITION_FLAG 0

#if URL_CONDITION_FLAG == 0           //测试环境

//服务器接口地址
#define SERVER_BASE_URL @"http://127.0.0.1/DMIS/api/"
//图片，音频文件的地址
#define RESOURCE_BASE_URL @"http://huhuupload.oss-cn-shenzhen.aliyuncs.com/"
//图片，音频文件的上传地址
#define FILE_UP_URL @"http://112.74.101.82:8080/huhu/"
#else                               //外网正式环境
#define SERVER_BASE_URL @"http://120.24.180.155/huhu/api/"
//图片，音频文件的地址
#define RESOURCE_BASE_URL @"http://huhuupload.oss-cn-shenzhen.aliyuncs.com/"
//图片，音频文件的上传地址
#define FILE_UP_URL @"http://120.24.180.155/huhu/"
#endif

/*************************************************/

#define DEVICE_TOKEN_USERDEFAULT_KEY @"DEVICE_TOKEN_USERDEFAULT_KEY"

/****荣联云相关****/

#define RLY_APP_KEY @"8a48b5514790f9dc01479eea4c4f04b8"

/********/

#define IOS_VERSION  ([[[UIDevice currentDevice] systemVersion] doubleValue])
#define iOS9_LATER (([[[UIDevice currentDevice]systemVersion] floatValue] >= 9.0) ? YES : NO)
#define iOS8_LATER (([[[UIDevice currentDevice]systemVersion] floatValue] >= 8.0) ? YES : NO)
#define iOS7_LATER (([[[UIDevice currentDevice]systemVersion] floatValue] >= 7.0) ? YES : NO)
#define iOS6_LATER (([[[UIDevice currentDevice]systemVersion] floatValue] >= 6.0) ? YES : NO)

//判断iphone4/4s
#define iPhone4_4s ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 960), [[UIScreen mainScreen] currentMode].size) : NO)
//判断iphone5/5s
#define iPhone5_5s ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)
//判断iphone6
#define iPhone6 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(750, 1334), [[UIScreen mainScreen] currentMode].size) : NO)
//判断iphone6+
#define iPhone6Plus ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2208), [[UIScreen mainScreen] currentMode].size) : NO)

#define ColorRGBA(R,G,B,A) [UIColor colorWithRed:(R/255.0) green:(G/255.0) blue:(B/255.0) alpha:A]

#define HeadWithString(string) [NSURL URLWithString:[NSString stringWithFormat:@"%@%@", RESOURCE_BASE_URL, string]]
#pragma mark - 屏幕尺寸
#define SCREEN_WIDTH [[UIScreen mainScreen] bounds].size.width
#define SCREEN_HEIGHT [[UIScreen mainScreen] bounds].size.height

#define FontWithSize(size) [UIFont systemFontOfSize:size]
#ifdef DEBUG
#define DLog(...) NSLog(__VA_ARGS__)
#else
#define DLog(...)
#endif

#endif /* GlobalConfig_h */
